<?php echo $this->Session->flash(); ?>

<h1>ASPIRANTES PROYECTO <?php echo$cod; ?></h1>

<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<table  id="tabla" class="tabla" >
    <thead>
        <tr>

            <th>Proyecto</th>
            <th>Documento Identidad</th>
            <th>Primer nombre</th>
            <th>Primer Apellido</th>
            <th>Segundo Apellido</th>
            <th>Tipo</th>
            <th colspan="3">Opciones</th>
        </tr>
    </thead>
    <tbody>

        <?php
        foreach ($candidates as $ben):

            switch ($ben['Candidate']['tipo']) {
                case 2:
                    $tp = "Campesino";
                    break;

                case 4:
                    $tp = "Desplazado";
                    break;
                case 5:
                    $tp = "Profesional";
                    break;


                default:
                    $tp = "";
                    break;
            }
            ?>

            <tr>

                <td><?php echo $cod ?></td>
                <td><?php echo $ben['Candidate']['nro_ident'] ?></td>
                <td><?php echo $ben['Candidate']['1er_nombre'] ?></td>
                <td><?php echo $ben['Candidate']['1er_apellido'] ?></td>
                <td><?php echo $ben['Candidate']['2do_apellido'] ?></td>
                <td><?php echo $tp ?></td>
                <td><?php echo $ajax->link("Familiares", array('controller' => 'Relatives', "action" => "index", $ben['Candidate']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?></td>
                <td><?php echo $ajax->link("Editar", array('controller' => 'Candidates', "action" => "edit", $ben['Candidate']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?></td>
                <td><?php echo $ajax->link("Eliminar", array('controller' => 'Candidates', "action" => "delete", $ben['Candidate']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading'), 'Tambien se borrará el filtro realizado al aspirante, sus familiares y los filtros realizados a ellos.') ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<br>
<br>
<legend><?php echo $ajax->link("Agregar Aspirante ", array('controller' => 'Candidates', "action" => "add"), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?></legend>





